package homework.day09; 
 /*
 @Time: 2022/7/21 20:31
 @Author:GShuai
 @File:Test03.class
 @Software:IntelliJ IDEA
*/

import java.util.Collection;
import java.util.HashSet;
import java.util.Random;

/**
 * 生成10个0-100之间的不重复的随机数,并输出
 */
public class Test03 {
    public static void main(String[] args) {
        Collection<Integer> set=new HashSet<>();
        Random random= new Random();
        while(set.size()<10){
            set.add(random.nextInt(100));
        }
        System.out.println(set);
    }
}
